//
//  ServiceBigTypeModel.m
//  Utils
//
//  Created by enghou on 2018/6/8.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "ServiceBigTypeModel.h"

@implementation ServiceBigTypeModel
-(instancetype)initWithSource:(NSDictionary *)source{
    self = [super initWithSource:source];
    if (self) {
        self.name = source[@"typeCname"];
        self.tid = source[@"typeKeyName"];
        NSArray *subTypes = source[@"subTypes"];
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *element in subTypes) {
            ServiceSubTypeModel *model = [[ServiceSubTypeModel alloc]initWithSource:element];
            model.parentId = self.tid;
            [array addObject:model];
        }
        self.children = array;
    }
    return self;
}
@end
